<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="demo">
        <p v-for="item in items" :key="item">
            {{ item }}
        </p>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        // 创建实例
        const app = new Vue({
            el: '#demo',

            data: {
                items: ['a', 'b', 'c', 'd', 'e']
            },
            mounted () {
                // 在 c 的前面插入 f
                setTimeout(() => {
                    this.items.splice(2, 0, 'f')
                }, 2000)
            },
        })
    </script>
</body>
</html>